package com.example.base.net

import com.example.base.entity.*
import okhttp3.RequestBody
import retrofit2.http.*

interface ApiService {

    @GET("/api/news")
    suspend fun getNews(): Res<NewsEntity>

    @GET("/api/announcements")
    suspend fun getNotices(@Query("page")page:Int, @Query("size")size:Int): Res<NoticeBean>

    @POST("/api/user/login")
    suspend fun login(@Query("username")username:String, @Query("password")password:String): Res<LoginEntity>

    @GET("/api/messages")
    suspend fun getMessage(@Query("accessId")accessId:String, @Query("userId")userId:Int): Res<MessageEntity>

    @GET("/api/parking-spaces/area/{areaId}")
    suspend fun getPick(@Path("areaId")areaId:Int):Res<ParkEntity>

    @POST("/api/parking-spaces")
    suspend fun getAddPark(@Body body: RequestBody):Res<ParkEntityItem>

    @PATCH("/api/parking-spaces/{id}/status")
    suspend fun getQuery(@Path("id")id:Int,@Query("status")status:String):Res<ParkEntityItem>

    @DELETE("/api/parking-spaces/{id}")
    suspend fun getDelete(@Path("id")id:Int):Res<Boolean>

}